package com.learn.excel.hawkeye.config;

import com.learn.excel.core.consts.Const;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * @author anri
 * @date 2021/6/1 13:10
 */
@Configuration
@ComponentScan(basePackages = {"com.hawkeye.hkrc.redis", "com.hawkeye.redis.*"})
public class HkRedisConfig {

    @Value("${spring.application.name}")
    private String pName;

    private static String prefix;

    @PostConstruct
    private void init() {
        prefix = pName + Const.PTN_COLON;
    }

    public static String getRedisCachePrefix() {
        return prefix;
    }

}
